package test.base;

public class EasyResponse {

    public static <T> HttpResponse<T> RF(T t) {
        HttpResponse<T> r = new HttpResponse<>();
        if (t == null) {
            r.setCode(400);
            r.setMsg("false");
            r.setData(null);
        } else {
            r.setData(t);
        }
        return r;
    }


    public static <T> HttpResponse<T> UR(T t, int ir) {
        HttpResponse<T> r = new HttpResponse<>();
        if (ir > 0) {
            r.setData(t);
            return r;
        } else {
            r.setCode(400);
            r.setMsg("failure");
            r.setData(null);
            return null;
        }
    }
}
